import Item from "../Item/index.jsx";
import "./index.scss"

export default function List(props){
  const {todos, dispatch} = props
  const total = todos.length
  return (
    <div className="todo-list">
      {total ?
        todos.map(item => {
          return <Item {...item} key={item.id} dispatch={dispatch}/>
        }) :
        <div className="todo-empty">暂无数据</div>
      }
    </div>
  );
}

